package com.neuralnoise.twitter;

import org.apache.log4j.Logger;

import twitter4j.User;

import com.neuralnoise.AbstractCrawler;

public class TwitterCrawler extends AbstractCrawler<Long> {

	private Logger logger = Logger.getLogger(this.getClass());
	
	public TwitterCrawler(TwitterDriver driver) {
		super(driver);
	}

	public static void main(String[] args) throws Exception {
		ParseArgs p = new ParseArgs(args);
		TwitterProperties properties = p.getProperties();

		TwitterDriver driver = new TwitterDriver(properties);
		Long sid = properties.getStartNode();
		if (sid == null) {
			User u = driver.getUser(properties.getStartScreen());
			sid = u.getId();
		}
		
		TwitterCrawler c = new TwitterCrawler(driver);
		c.breadthFirstGraphExploration(sid, properties.getMillis());
	}

}
